import {
    Http
} from "../utils/http.js";

class Cart {
    static getCart(shop_id, order_type) {
        return Http.request({
            url: `/shopcar/get_car_list`,
            data: {
                shop_id,
                order_type
            }
        })
    }

    static changeCart(type, gid, shop_id, order_type, attr_id = 0, attr_value = "") {
        const url = type == "add" ? '/shopcar/add_car' : '/shopcar/minus_car'
        return Http.request({
            url: url,
            data: {
                gid,
                shop_id,
                order_type,
                attr_id,
                attr_value
            }
        })
    }


}
export {
    Cart
}